package inflection;

import java.lang.reflect.Field;

public class Inflection02 {
    public static void main(String[] args) throws Exception {
        Class studentClass = Student.class;

        Field[] declaredFields = studentClass.getDeclaredFields();
        for (Field declaredField : declaredFields) {
            System.out.println(declaredField.getName()+"   " + declaredField.getType());
        }

        Student student = new Student();
        Field name = studentClass.getDeclaredField("name");
        name.setAccessible(true);
        name.set(student,"Lim");
        System.out.println(student);
    }
}
